package com.fenxiangle.yueding.feature.mine.view.adapter;

import android.text.TextUtils;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fenxiangle.yueding.R;
import com.fenxiangle.yueding.entity.VedioShowType;
import com.fenxiangle.yueding.entity.VedioType;
import com.fenxiangle.yueding.entity.bo.PhotoBo;
import com.fenxiangle.yueding.entity.bo.UserCenterBo;
import com.fenxiangle.yueding.entity.bo.UserVideoBo;
import com.suozhang.framework.framework.AM;

public class PhotoAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    private boolean isAdd;

    public PhotoAdapter(boolean isAdd) {
        super(R.layout.item_photo);
        this.isAdd = isAdd;
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        helper.setVisible(R.id.btn_show_upload, TextUtils.isEmpty(item) && isAdd ? true : false)
                .setText(R.id.btn_show_upload, helper.getLayoutPosition() == 0 ? "如果无视频则默认此照片\n为首页展示照片" : "")
                .addOnClickListener(R.id.btn_show_upload)
                .addOnClickListener(R.id.photo_img)
                .addOnLongClickListener(R.id.photo_img)
        ;
        if (!TextUtils.isEmpty(item)) {
            AM.image().bind(item, helper.getView(R.id.photo_img));
        }

    }
}
